package com.hzxy.yiyid.web.module.repository.entity;

import com.hzxy.yiyid.web.common.constants.YiyidConstants;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName MedicineDo
 * @Description 药品
 * @Author RAICOM2023
 * @Date 2023/4/28 20:42
 * @Version 1.0
 **/
@Data
@Entity
@Table(name = "yiyi_medicine")
public class MedicineDo implements Serializable {
    private static final long serialVersionUID = -5117283281583573676L;

    @Id
    @Column(name = "medicine_id")
    @GenericGenerator(
            name = "generator_yiyi_medicine",
            strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
            parameters = {
                    @Parameter(name = "sequence_name", value = "s_yiyi_medicine"),
                    @Parameter(name = "initial_value", value = "1"),
                    @Parameter(name = "increment_size", value = "1")
            }
    )
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "generator_yiyi_medicine")
    private Long medicineId;

    /**
     * 国药准字
     */
    @Column(name = "gyzz")
    private String gyzz;

    /**
     * 药品名称
     */
    @Column(name = "chinese_name")
    private String chineseName;

    /**
     * 英文名称
     */
    @Column(name = "english_name")
    private String englishName;

    /**
     * 汉语拼音
     */
    @Column(name = "pinyin")
    private String pinYin;

    /**
     * 是否处方药
     */
    @Column(name = "is_rx")
    private String isRx;

    /**
     * 企业名称
     */
    @Column(name = "company")
    private String company;

    /**
     * 主治功能
     */
    @Column(name = "function",columnDefinition="TEXT")
    private String function;

    /**
     * 药品成分
     */
    @Column(name = "ingredients",columnDefinition="TEXT")
    private String ingredients;

    /**
     * 不良反应
     */
    @Column(name = "adrs",columnDefinition="TEXT")
    private String adrs;

    /**
     * 相互作用
     */
    @Column(name = "interaction",columnDefinition="TEXT")
    private String interaction;

    /**
     * 执行标准
     */
    @Column(name = "standard")
    private String standard;

    /**
     * 禁忌
     */
    @Column(name = "taboo",columnDefinition="TEXT")
    private String taboo;

    /**
     * 性状
     */
    @Column(name = "character")
    private String character;

    /**
     * 规格
     */
    @Column(name = "specifications",columnDefinition="TEXT")
    private String specifications;

    /**
     * 用法用量
     */
    @Column(name = "usage",columnDefinition="TEXT")
    private String usage;

    /**
     * 注意事项
     */
    @Column(name = "attention",columnDefinition="TEXT")
    private String attention;

    /**
     * 保存时间
     */
    @Column(name = "save_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date saveTime = new Date();;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = YiyidConstants.DATE_FORMAT_DEFAULT_VIEW)
    private Date updateTime;

    /**
     * 价格
     */
    @Column(name = "price")
    private double price;

}
